﻿/*****************************************************************//**
 *
 * @file   FITKAbaqusHDF5AdaptorOutput.h
 * @brief  Abaqus HDF5 Output 适配器 用于读取HDF5过程中的Output解析。
 * @author fulipeng (flipengqd@yeah.net)
 * @date   2024-06-06
 *
 *********************************************************************/
#ifndef __FITKABAQUSHDF5ADAPTOROUTPUT__H__
#define __FITKABAQUSHDF5ADAPTOROUTPUT__H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITKAbaqusHDF5AbstractAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Interface/FITKInterfaceIOHDF5/FITKInterfaceHDF5AdaptorBoundaryLocation.h"

 //前置声明
ForwardDeclarNS(AbaqusData, FITKDataCase)
ForwardDeclarNS(Interface, FITKAbaAssembly)
ForwardDeclarNS(Interface, FITKComponentManager)
ForwardDeclarNS(Interface, FITKAbaAbstractStep)
ForwardDeclarNS(Interface, FITKAbaAbstractOutput)
ForwardDeclarNS(Interface, FITKAbaStepManager)

namespace IO
{
    /**
     * @brief Abaqus Output 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-06-06
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorOutput : public FITKInterfaceHDF5AdaptorBoundaryLocation
    {
    public:
        explicit FITKAbaqusHDF5AdaptorOutput() = default;
        ~FITKAbaqusHDF5AdaptorOutput() = default;


        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        QString getAdaptorClass() override;

        /**
         * @brief 设置管理器
         * @param stepManager 分析步管理器
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        void setStepManager(Interface::FITKAbaStepManager* stepManager);

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        bool adaptW() override;

        /**
         * @brief 写出输出结构
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        bool readOutput(Interface::FITKAbaAbstractOutput* output, H5::Group& h5Group);

        /**
         * @brief 写出输出结构
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        bool readFieldOutput(Interface::FITKAbaAbstractOutput* output, H5::Group& h5Group);

        /**
         * @brief 写出输出结构
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        bool readHistoryOutput(Interface::FITKAbaAbstractOutput* output, H5::Group& h5Group);

        /**
         * @brief 写出输出结构
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        bool writeOutput(Interface::FITKAbaAbstractOutput* output, H5::Group& h5Group);

        /**
         * @brief 写出输出结构
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        bool writeFieldOutput(Interface::FITKAbaAbstractOutput* output, H5::Group& h5Group);

        /**
         * @brief 写出输出结构
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        bool writeHistoryOutput(Interface::FITKAbaAbstractOutput* output, H5::Group& h5Group);

    private:
        /**
         * @brief 分析步管理器
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        Interface::FITKAbaStepManager* _stepManager{};



    };

    Register2FITKIOAdaptorFactory(HDF5, Interface::FITKAbaAbstractOutput, FITKAbaqusHDF5AdaptorOutput)

}
#endif